<template>
  <div class="aa-container">
    <div class="material-textfield green width-full" :class="{'validate-err': errors.has('companyPrincipal')}">
      <input type="text" required v-model="suggannex.companyPrincipal"  v-validate="'required'" name="companyPrincipal"/>
      <label data-content="单位负责人*" ></label>
    </div>
    <div class="textarea-con" :class="{'validate-err': errors.has('companySuggestion')}">
      <label data-content="申报建议*">申报建议*&nbsp;&nbsp;&nbsp;<span class="lg-promp">不超过100字</span></label>
      <textarea rows="3" class="width-full" v-model="suggannex.companySuggestion" v-validate="'required|min:1|max:100'" name="companySuggestion"></textarea>
    </div>
  </div>
</template>

<script>
  export default {
    title: '申报建议及附件',
    name: 'suggest-annex',
    props: {
      data: {}
    },
    data () {
      return {
        suggannex: {}
      }
    },
    methods: {
      validate () {
        return this.$validator.validateAll()
      }
    },
    mounted () {
      this.suggannex = Object.assign({}, this.data)
    },
    watch: {
      'suggannex': {
        handler: function (val, oldVal) {
          this.$emit('update:data', this.suggannex)
        },
        deep: true
      },
    }
  }
</script>
